import 'package:flutter/material.dart';
import 'package:x3_component_core/components/button_components/base_icon_button.dart';

/**
 * 用于输入框右边的清除
 */
class BaseClearButton extends StatelessWidget {

  final VoidCallback onPress;

  const BaseClearButton({Key key, @required this.onPress}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (this.onPress == null) return SizedBox();
    return BaseIconButton(
      background: Colors.transparent,
      iconSize: 18,
      icon: Icons.cancel,
      onPress: this.onPress,
    );
  }

}
